﻿define(function (require, exports, module) {
    "require:nomunge,exports:nomunge,module:nomunge";
    var $ = require("jquery"),
        forimg = require("forimg")
    ;
    
    var init = function () {
        var $page = $("#page");

        
        bind();
    };

    var bind = function () {
        var $page = $("#page");

        $page.on("click", ".fgn_item", function () {
            var $this = $(this),
                $box = $this.closest(".floor_goods"),
                _index = $box.find(".fgn_item").index($this)
            ;
            console.log(_index);

            $box.find(".fgn_item").removeClass("fgn_item_cur")
            $this.addClass("fgn_item_cur");

            $box.find(".fgc_item").fadeOut(0);
            $box.find(".fgc_item").eq(_index).fadeIn(800);

            return false;
        });

    };

    init();


   
});
